﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎登录后台管理系统--模板之家 www.cssmoban.com</title>
<link href="__ACSS__/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="__AJS__/jquery.js"></script>
<script src="__AJS__/cloud.js" type="text/javascript"></script>

<script language="javascript">
	$(function(){
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
	$(window).resize(function(){
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
    })
});
</script>

</head>

<body style="background-color:#1c77ac; background-image:url(__AIMG__/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">



    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  


<div class="logintop">    
    <span>欢迎登录后台管理界面平台</span>    
    <ul>
    <li><a href="#">回首页</a></li>
    <li><a href="#">帮助</a></li>
    <li><a href="#">关于</a></li>
    </ul>    
    </div>
    
    <div class="loginbody">
    
    <span class="systemlogo"></span>

    <div class="loginbox">
        <form action="Login/chec1k" method="post">
            <ul>
                <div class="output-html"></div>
            <li><input name="username" type="text" class="loginuser" id="username"/></li>
            <li><input name="password" type="password" class="loginpwd" id="password"/></li>
            <li>
                <img border="border:1px solid red;" src="{:url('admin/login/captchas')}" alt="captcha" onclick="this.src = '{:url('admin/login/captchas')}?hhhhhh='+Math.random()"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="text" name="captcha" class ='captcha' id="captcha" />
            </li>
            <li><input name="" type="button" class="loginbtn" value="登录"/><label><input name="" type="checkbox" value="" checked="checked" />记住密码</label><label><a href="#">忘记密码？</a></label></li>
            </ul>
        </form>
    </div>
    </div>
    
    
    
    <div class="loginbm">版权所有  2013  .com 仅供学习交流，勿用于任何商业用途</div>
</body>
<script language="javascript" type="text/javascript">
    $(document).ready(function(){
        //提示信息
        function tipss(mas) {
            setTimeout(function(){
                $(".output-html").html(mas).show()
            }, 0);
            setTimeout('$(".output-html").hide()', 1000)
            return false;
        }
        //回车搜索;$(".search-input")是输入框；$("#search")是收索按钮
        $(".captcha").keyup(function(e){
            if(e.keyCode === 13){
                //执行收索按钮的click事件
                $(".loginbtn").click();
                return false;
            }
        });
        //判断是否输入完整
        $(".loginbtn").click(function () {
            var username = $("#username").val();
            var password = $("#password").val();
            var captcha = $("#captcha").val();
            if (username == '') {
                tipss("<font color='#FF0000' size='4px'><center>用户名不能为空</center></font>");
                return false;
            } else if (password == '') {
                tipss('<font color="#FF0000" size="4px"><center>密码不能为空</center></font>');
                return false;
            } else if (captcha == '') {
                tipss("<font color='#FF0000' size='4px'><center>验证码不能为空</center></font>");
                return false;
            }else{
                var formData=$("form").serializeArray();
                $.ajax({
                    type:'post',
                    url:"{:url('Login/check')}",
                    data:formData,
                    success:function(data){
                        if(data==-1){
                            tipss("<font color='#FF0000' size='4px'><center>验证码错误！</center></font>");
                        }else if(data==-2){
                            tipss("<font color='#FF0000' size='4px'><center>用户名或密码错误！</center></font>");
                        }else{
                            window.location.href='__ROOT__'+"/index.php/admin/index/index";//你可以跟换里面的网址，以便成功后跳转
                            return false;
                        }
                    }
                })
            }
//            window.location.reload();
        })
    });
</script>
</html>
